Ext.define('appmod.view.mycfs.MycfsEditingForm', {
    extend: 'Ext.form.Panel',
    alias: ['widget.mycfs.editingform', 'widget.mycfs-editingform'],
    bodyPadding: 10,
	
    initComponent: function() {
      var me = this;

      Ext.applyIf(me, {
	  	    fieldDefaults: {
            	labelWidth: 80
        	},
			autoScroll:true,
            items: [
                {
                    xtype: 'hiddenfield',
                    name: 'id',
                    fieldLabel: 'id'
                },
                {
                    xtype: 'textfield',
                    name: 'title',
                    fieldLabel: '主题',
					anchor: '50%',
					allowBlank:false
                },
                {
                    xtype: 'textfield',
                    name: 'keyword',
                    anchor: '50%',
					fieldLabel: '关键字'
                },
				{
                    xtype: 'htmleditor',
                    name: 'content',
                    anchor: '95%',
					height: 250,
					fieldLabel: '内容'
                },
				{
                    xtype: 'fieldcontainer',
					fieldLabel: '附件',
					anchor: '95%',
					items:[
						{
							xtype: 'tabpanel',
							activeTab: 0,
							plain: true,
					        defaults :{
					            autoScroll: true,
					            bodyPadding: 10
					        },
							items:[
								{
									title: '附件',
									items: [
										{
											xtype: 'filefield',
											buttonOnly: true,//仅显示按钮
				        					hideLabel: true,//隐藏标签
						                    buttonText: '添加附件',
											listeners: {
												'change': function(fb, v){
													me.fireEvent('addAttchment',{
														window : me,
														formPanel: me,
														fb:fb,
														v:v
													});	
												}
											}
										},
										{
											xtype:'grid',
											name:'attachmentGrid',
											columns:[
												{
								                    xtype: 'gridcolumn',
								                    dataIndex: 'name',
													minWidth:200,
								                    text: '附件名称'
								                },
								                {
								                    xtype: 'gridcolumn',
								                    dataIndex: 'coller',
								                    minWidth:130,
													text: '操作',
													renderer: function (value, cellmeta) { return "<INPUT type='button' value='删除'>";}
								                }
											]
											
										},
								
									
										
									]
								}
							]
						}
					]
                },
				
				{
					xtype: 'container',
            		anchor: '100%',
            		layout: 'hbox',
			  	    fieldDefaults: {
		            	labelWidth: 65
		        	},					
					items:[{
		                xtype: 'container',
        	        	flex: 1,
            	    	layout: 'anchor',
               		 	items: [
						{
                    		xtype:'displayfield',
                    		fieldLabel: '创建日期',
                    		name: 'createdDate',
                    		anchor:'95%'
                		}, {
                    		xtype:'displayfield',
                    		fieldLabel: '创建人',
                    		name: 'createdUser',
                    		anchor:'95%'
                		}]
            		},{
		                xtype: 'container',
		                flex: 1,
		                layout: 'anchor',
		                items: [
						{
                    		xtype:'displayfield',
                    		fieldLabel: '更新日期',
                    		name: 'updatedDate',
                    		anchor:'95%'
                		}, {
                    		xtype:'displayfield',
                    		fieldLabel: '更新人',
                    		name: 'updatedUser',
                    		anchor:'95%'
                		}]
            		}
					]
				}								
            ]			
        });

        me.callParent(arguments);
    }

});